﻿namespace ETestIT.UI.Presentation
{
    using Core.Storage;
    using DataAccess;
    using Domain.Repositories;
    using Domain.Services;
    using StructureMap;

    public class Bootstrapper
    {
        public static void Init()
        {
            ObjectFactory.Initialize(x =>
            {
                x.ForRequestedType<IAuthenticationService>().TheDefaultIsConcreteType<AuthenticationServiceImpl>();
                x.ForRequestedType<ICandidateResumeService>().TheDefaultIsConcreteType<CandidateResumeServiceImpl>();

                x.ForRequestedType<IUserRepository>().TheDefaultIsConcreteType<UserRepositoryImpl>();
                x.ForRequestedType<ICadidateRepository>().TheDefaultIsConcreteType<CadidateRepositoryImpl>();
                x.ForRequestedType<IResumeRepository>().TheDefaultIsConcreteType<ResumeRepositoryImpl>();
                x.ForRequestedType<ICandidateResumeRepository>().TheDefaultIsConcreteType<CandidateResumeRepositoryImpl>();
                x.ForRequestedType<IJobTitleRepository>().TheDefaultIsConcreteType<JobTitleRepositoryImpl>();
                
                x.ForRequestedType<ISessionStorage>().TheDefaultIsConcreteType<SessionStorage>();
                x.ForRequestedType<ILocalStorage>().TheDefaultIsConcreteType<LocalStorage>();
                x.ForRequestedType<IAppStorage>().TheDefaultIsConcreteType<AppStorage>();
            });
        }
    }
}